<template>
  <div class="dv">
    <p>组件生命周期</p>
  </div>
</template>

<script setup>
import { onBeforeMount, onMounted } from "vue";
//组合式api
onBeforeMount(() => {
  console.log("Dom元素渲染之前", document.querySelector(".dv"));
});
onMounted(() => {
  console.log("Dom元素渲染之后", document.querySelector(".dv"));
});
</script>

<style>
</style>